﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Configuration;
using Bestlife.ERP.DataAccess;

/// <summary>
/// Summary description for User_Availability
/// </summary>
namespace Bestlife.ERP.DataAccess
{
    public class D_User_Availability
    {
        public D_User_Availability()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        public static String username(string username)
        {
            string okay = "";
            SqlConnection conn_new = new SqlConnection();
            try
            {
                String connStr = ConfigurationManager.ConnectionStrings["MainConnStr"].ConnectionString;
                Bestlife.ERP.DataAccess.clsCon.connect(connStr);

                String Ssql = "SELECT [Use_Name] FROM [Tbl_User] where Use_Name='" + username + "'";
                //SqlDataReader ldr = Bestlife.ERP.DataAccess.clsCon.ReadTable(Ssql);

                SqlDataReader rdR;
                rdR = clsCon.ReadTable(Ssql);

                if (rdR.Read())
                {
                    okay = "1";
                }
                else
                {
                    okay = "0";
                }
            }
            catch (Exception)
            {
                // Console.WriteLine(exx);
            }
            return okay;

        }


    }
}